package service

import "context"

// Hello2Service describes the service.
type Hello2Service interface {
	// Add your methods here
	// e.x: Foo(ctx context.Context,s string)(rs string, err error)
	Foo(ctx context.Context, s string) (rs string, err error)
}

type basicHello2Service struct{}

func (b *basicHello2Service) Foo(ctx context.Context, s string) (rs string, err error) {
	// TODO implement the business logic of Foo
	rs = "hello, i am jack"
	return rs, err
}

// NewBasicHello2Service returns a naive, stateless implementation of Hello2Service.
func NewBasicHello2Service() Hello2Service {
	return &basicHello2Service{}
}

// New returns a Hello2Service with all of the expected middleware wired in.
func New(middleware []Middleware) Hello2Service {
	var svc Hello2Service = NewBasicHello2Service()
	for _, m := range middleware {
		svc = m(svc)
	}
	return svc
}
